package com.wr.service.com.wr.serializer;

import com.alibaba.fastjson.JSON;

/**
 * @author 王瑞
 * @description: TODO
 * @date 2020/3/22  14:46
 */
public class JSONSerializer implements Serializer {

    public byte[] serialize(Object object) {

        return JSON.toJSONBytes(object);

    }




    public <T> T deserialize(Class<T> clazz, byte[] bytes) {

        return JSON.parseObject(bytes, clazz);

    }
}
